package com.hntest.entity;

import java.io.Serializable;
import java.util.Date;

public class BaseAuditDomain implements Serializable {
    private static final long serialVersionUID = -6040182684588193535L;
    public static final int STATE_APPLY=0;  //申请状态
    public static final int STATE_PASS=1;   //审核通过
    public static final int STATE_REJECT=-1;//审核拒绝


    private String remark;      //审核时的备注信息
    private LoginInfo applier;  //申请人
    private LoginInfo auditor;  //审核操作员
    private Date auditTime;     //审核操作时间
    private Date applyTime;     //申请时间
    private int state=STATE_APPLY;//状态

    public String getStateDisplay(){
        switch (state){
            case STATE_APPLY:
                return "申请状态";
            case STATE_PASS:
                return "审核通过";
            case STATE_REJECT:
                return "审核拒绝";
            default:
                return "错误状态";
        }
    }

    public BaseAuditDomain(){}

    public BaseAuditDomain(String remark, LoginInfo applier, LoginInfo auditor, Date auditTime, Date applyTime, int state) {
        this.remark = remark;
        this.applier = applier;
        this.auditor = auditor;
        this.auditTime = auditTime;
        this.applyTime = applyTime;
        this.state = state;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public LoginInfo getApplier() {
        return applier;
    }

    public void setApplier(LoginInfo applier) {
        this.applier = applier;
    }

    public LoginInfo getAuditor() {
        return auditor;
    }

    public void setAuditor(LoginInfo auditor) {
        this.auditor = auditor;
    }

    public Date getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(Date auditTime) {
        this.auditTime = auditTime;
    }

    public Date getApplyTime() {
        return applyTime;
    }

    public void setApplyTime(Date applyTime) {
        this.applyTime = applyTime;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return  "\n备注='" + remark + '\'' +
                ", 申请人=" + applier +
                ", 审核人=" + auditor +
                ", 审核时间=" + auditTime +
                ", 申请时间=" + applyTime +
                ", 申请状态=" + state +
                '}';
    }
}
